import java.util.*;

public class Main {
    public static int gcd(int a, int b) {
        while (b != 0) {
            int temp = b;
            b = a % b;
            a = temp;
        }
        return a;
    }

    public static int lcm(int a, int b) {
        return a / gcd(a, b) * b; // 防止溢出
    }

    public static boolean isNarcissus(int n) {
        int a = n%10;//个位
        int b = n/10%10;//十位
        int c = n/100;//百位
        if(a*a*a + b*b*b + c*c*c == n){
            return true;
        }
        return false;
    }
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        for(int i=100;i<1000;i++) {
            if(isNarcissus(i)) {
                System.out.println(i);
            }
        }
    }
}
